-
Notifications
You must be signed in to change notification settings - Fork 999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHOENIX-5181 support Math sin/cos/tan functions #458
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we handle decimal type in general in Phoenix? In my previous databases since the percision is possibly much higher than a double special mathematical considerations had to be done or decimal disallowed?
@yanxinyi overall looks good. I think the offline discussions we had regarding precision and rounding errors are the main points of concern. Can you add tests that reflect such cases? |
Offline synced with @ChinmaySKulkarni about the precision issue, and Phoenix PDecimal class already takes care of it. Other similar Math functions, such as power, implemented the same way as I do, but |
Can you add some IT's that test the grammar as well? @yanxinyi |
@karanmehta93 added IT tests |
Offline discussed with @karanmehta93, used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1.
@karanmehta93 , were there any other changes you wanted to the trig function feature? |
ddl = | ||
"CREATE TABLE " + tableName + " (k VARCHAR NOT NULL PRIMARY KEY, doub DOUBLE)"; | ||
conn.createStatement().execute(ddl); | ||
conn.commit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit is not needed after ddl statements.
|
||
literal = LiteralExpression.newConstant(value, dataType, SortOrder.DESC); | ||
boolean ret2 = testExpression(literal, expectedResult, testedFunction); | ||
assertEquals(ret1, ret2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this required? If both ret1
and ret2
return false, this would still pass. Is that intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed offline, @yanxinyi will fix this in another Jira.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution and addressing the comments. Looks good to merge.
No description provided.